<?php
include '../Core/function.php';
$data = include '../database/database.php';

foreach ($data as $key => $value) {
	$result[] = $key;
}

if( $_GET && isset($_GET['id']) && in_array($_GET['id'], $result)) {

	$id = (int)$_GET['id'];

	unset( $data[$id] );

	$data = var_export( $data, true );

	$str = '<?php return '.$data.' ?>';

	
	file_put_contents( '../database/database.php' , $str);

	success('../index.php','删除成功');
}else{
	error('../index.php','非法访问');
}
?>